import { ecs } from 'db://app-game/libs/ecs/ECS';
import { Graph } from 'db://app-game/libs/math/graph/Graph';
import { HomeBase } from '../../home-base/HomeBase';
import { FlowGridObjType, Lineup } from '../LevelMap.type';

/** 地图渲染模型组件 */
@ecs.register('LevelMapModelRender')
export class LevelMapModelRenderComp extends ecs.Comp {
  /** 是否渲染完成 */
  isRender = false;

  /** 渲染地图网格 */
  graph: Graph;
  /** 流动网格 */
  flowGridObj: FlowGridObjType = {
    [Lineup.Player]: null,
    [Lineup.AI]: null,
  };

  /** 玩家基地 */
  playerHomeBase: HomeBase;

  /** ai基地 */
  aiHomeBase: HomeBase;

  reset(): void {
    this.isRender = false;
    this.graph = null;

    this.flowGridObj = {
      [Lineup.Player]: null,
      [Lineup.AI]: null,
    };

    this.playerHomeBase = null;
    this.aiHomeBase = null;
  }
}
